In battery powered devices, the direction of the electrical current during charging is inverse with respect to the direction during use of the device, when the load is switched on. During use, typically a switchable electrical load, like a motor or similar is switched on. For several reasons, it is important that both the electrical charging and discharging current are measured with high accuracy. Firstly, knowledge of the charging and discharging current of the secondary battery might be required to determine its charge level by Coulomb counting or detecting the end of charging. Additionally, if the electrical load is a motor, the value of the motor current which is to some extend identical to the discharging current might be used for a rotation speed control or overload. Typically, the control of the electrical load and the measurements are performed by a microcontroller within the device.
For measuring electrical currents in both directions (also denoted as opposed currents in the application), several possibilities are known. The first solution comprises a shunt and an analog-digital converter (ADC) with differential channels typically incorporated into a microcontroller.
Such an ADC having differential channels can measure voltages of both polarities between two input pins of the ADC. The shunt resistor is placed for example at any of the two terminals of the secondary battery and the input pins of the ADC are each connected to one end of the shunt. In such an electronic circuit, the charging current and discharging current both have to pass the shunt resulting in a voltage drop over it. This voltage drop has inverse polarity for charging and discharging, making a differential ADC necessary, which can pick up voltages of both polarities. However, microcontrollers with differential ADCs are more expensive than single-ended ADCs, and an electronic circuit using it occupies two pins of the microcontroller.
A respective electronic circuit is described in US 2007/0190396 A1 having two shunt resistors for measuring the charging and discharging currents, respectively, flowing in opposed directions through the secondary battery using an ADC with differential channels measuring the voltage difference over the one or the other shunt resistor, depending on the direction of the opposed currents during charging and discharging.
Another electronic circuit for such a task uses operational amplifiers to circumvent the problem of negative voltages. But not only that an operational amplifier is a very expensive part, it also has to be calibrated during manufacture, resulting in even higher costs and making it unsuitable for the use in cheap mass products.
An alternative electronic circuit uses two single-ended ADCs or one single ended ADC with two input pins, that can be used equivalent to two single-ended ADCs. Such a circuit further comprises two shunts, one for charging and one for the discharging through the motor or load. One of the shunts, the battery shunt is placed in series to the battery and the first ADC is connected to the side of the shunt that has a positive voltage during charging. The other shunt, the motor or load shunt is placed in series to the motor or load and the second ADC is connected to that end of the shunt that has a positive voltage during use of the device. This electronic circuit has the disadvantage that it uses two microcontroller pins. Additionally, during use of the device, when the motor or similar load is running, the electrical current has to pass both shunts, resulting in a doubling of the power dissipation due to the measuring circuit.
It is therefore an object of the present invention to provide an electronic circuit for efficiently measuring the current in both directions without the above mentioned disadvantages.